package com.u.character;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.mysql.jdbc.Statement;
import com.u.eventInfo.EventInfo;
import com.u.eventInfo.EventLog;
import com.u.tool.MysqlUtil;
import com.u.toolbox.AbstractToolBox;
import com.u.toolbox.ToolBox;

public class Station extends Role{
	
	String StationCode;
	String StationName;
	
	public Station(Role role) {
		super(role);
		this.StationCode = role.getUseracc().substring(1,5);
		MysqlUtil db = new MysqlUtil();
		String sql = "select * from y_r.bank_station where id=" + StationCode;
		db.connection();
		try {
			db.st = (Statement) db.conn.createStatement();
			ResultSet res = db.st.executeQuery(sql);
			while(res.next()) {
				this.StationName = res.getString("name");
				System.out.println(this.StationName);
			}
		}catch(Exception e){
			e.printStackTrace();
		}finally {
			db.close();
		}
	}

	
	
	public String getStationCode() {
		return StationCode;
	}



	public void setStationCode(String stationCode) {
		StationCode = stationCode;
	}
	
	public String getStationName() {
		return StationName; 
	}

	
	
	

}
